import 'package:find_friend/const/const.dart';
import 'package:find_friend/pages/mine/certifacation/mine_cer_upload.dart';
import 'package:find_friend/pages/mine/mine_info.dart' show MineInfoCell;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class MineCertifacationPage extends StatefulWidget {
  @override
  _MineCertifacationPageState createState() => _MineCertifacationPageState();
}

class _MineCertifacationPageState extends State<MineCertifacationPage> {

  Widget _createCell(String title, String detail) {
    return MineInfoCell(title, detail: detail, detailRightPadding: 5, titleFontSize: 14,detailFontSize: 11, detailColor: APP_font_deep_grey);
  }
  @override
  Widget build(BuildContext context) {
    
    final size = MediaQuery.of(context).size;

    return Scaffold(
      backgroundColor: APP_scaffold_back_color,
      appBar: AppBar(
        title: Text("学校信息"),
        backgroundColor: Colors.white,
        centerTitle: true,
        leading: IconButton(
          onPressed: (){
            Navigator.of(context).pop();
          },
          icon: Image.asset("assets/fanhui.png"),
        ),
      ),
      body: Stack(
        children: [
          Padding(
            padding: const EdgeInsets.all(10),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Container(
                  padding: const EdgeInsets.only(left: 10),
                  decoration: BoxDecoration(
                    border: Border.all(color:APP_divider_color, width: 0.5),
                    borderRadius: BorderRadius.circular(5),
                    color: Colors.white
                  ),
                  child: MineInfoCell("真是姓名", detail: "仅用于身份审核", titleFontSize: 14,detailFontSize: 11, detailColor: APP_font_deep_grey,),
                ),
                Padding(
                  padding: const EdgeInsets.only(top: 2, left: 6, bottom: 10),
                  child: Text("*务必填写真实姓名，与证件不一致将会被直接审核拒绝", style: instanceTextStyle(10, APP_verify_error_color),),
                ),
                Container(
                  padding: const EdgeInsets.only(left: 10, right: 5),
                  decoration: BoxDecoration(
                    border: Border.all(color:APP_divider_color, width: 0.5),
                    borderRadius: BorderRadius.circular(5),
                    color: Colors.white
                  ),
                  child: Column(
                    children: [
                      MineInfoCell(
                        "真是姓名", 
                        detail: "去认证", 
                        detailRightPadding: 5, 
                        titleFontSize: 14,
                        detailFontSize: 11, 
                        detailColor: APP_main_color, 
                        isShowArrow: true,
                        callback: (){
                          push(context, MineCerUpoadPage());
                        },
                      ),
                      _createCell("学号", "00000"),
                      _createCell("学校", "学校名称"),
                      _createCell("学院", "学院名称"),
                      _createCell("专业", "专业名称"),
                    ],
                  ),
                ),
              ],
            ),
          ),

          Positioned(
            left: 50,
            right: 50,
            bottom: 150.h,
            child: Container(
              width: size.width,
              alignment: Alignment.center,
              padding: const EdgeInsets.symmetric(vertical: 10),
              decoration: BoxDecoration(
                color: APP_main_color,
                borderRadius: BorderRadius.circular(20)
              ),
              child: Text("提交", style: instanceTextStyle(14, Colors.white),),
            ),
          )
        ],
      ),
    );
  }
}